package com.zbkj.service.manager;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zbkj.dal.base.enums.BooleanEnums;
import com.zbkj.dal.dao.EmployeeAccountDao;
import com.zbkj.dal.entity.user.EmployeeAccount;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class EmployeeManagerImpl implements EmployeeManager {

    @Resource
    private EmployeeAccountDao employeeAccountDao;

    public EmployeeAccount findEmployeeAccount(Integer accountId, String accountType) {
        LambdaQueryWrapper<EmployeeAccount> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(EmployeeAccount::getAccountId, accountId);
        wrapper.eq(EmployeeAccount::getAccountType, accountType);
        wrapper.eq(EmployeeAccount::getDeleted, BooleanEnums.FALSE.getCode());
        return employeeAccountDao.selectOne(wrapper);
    }

}
